
#ifndef spotConf_h
#define spotConf_h

#include "WProgram.h"
#include "soundSpot.h"  // this is a derived class of livingSpot, with sending capabilities (for sound). 

// Do not instantiate more than 4 spots (memory problems...)
#define NBSPOTS 4

class SpotConfiguration {
  public:
  
   //========== Methods =============
   
   SpotConfiguration(); // overaloded constructor
   
   void allSpotsInit();
   void killAll();
   
   void contourFollowingOnly(int nbSpots);
   void snellLawOnly(int nbSpots);
   void newtonianBouncingOnly(int nbSpots);
   void fastBouncingOnly(int nbSpots);
   void simpleBouncingOnly(int nbSpots);
   
   // Special modes:
   void allStandBy();
   void measureMode();
   void scanAreaMode();
   
   // special tailored "demo" modes (used in particular in the scheduler):
   void oneContourFollowing();
   void twoContourFollowing();
   void oneSimpleBouncing();
   void twoSimpleBouncing();
   void oneSnellLaw();
   
   void update();
   void sendConfData();
   void stopAllSending();
   
   void resetTimer();
   unsigned long timeRunning();
   
   void drawScanningArea();
   void simpleTransitionStep();
   void transitionStep();
  
  //========== Variables =============
   int numSpots;
   soundSpot spotArray[NBSPOTS]; // Attention: here the default constructor is called. It should not use any arduino function relating to hardware that has not been initialized (before the setup function). Instead, use an "init" method. 

  // HARDWARE SENDING MODE (GLOBAL) - can be changed by serial or osc commands:
  boolean sendAllOSC;
  boolean sendAllSerial;
  boolean sendAllMIDI;
  
    // WHAT DATA TO SEND (not exclusive!):
    boolean sendingAllPosition;
    boolean sendingAllColor; // in fact, mean intensity of the saccade
    boolean sendingAllCollision;
    boolean sendingAllTouchWall;
    boolean sendingAllAngle; 

  // timer for checking how long THIS config has been running: 
  unsigned long configAge;

};

#endif


